<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\api\model\CategoryModel;
use think\Request;
/**
 * 示例接口
 */
class Category extends Api{
    protected $noNeedLogin = [];
    protected $noNeedRight = ['*'];
    protected $where = ['is_show'=>1];
    public function __construct(Request $request = null)
{
    $this->Model = new CategoryModel;
    parent::__construct($request);
}

    /**
     * @return data
     * 获取文章列表
     */
    public function info()
    {
        $data = $this->Model
            ->where($this->where)
            ->select();
        if(empty($data))
        {
            $this->error('无数据');
        }
       $this->success('请求成功',$data,1);
    }

}
